<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html>
 <head>
  <title>jsapi微信支付前台demo</title>
  <meta name="keywords" content="关键字">
  <meta name="description" content="描述">
  <meta name="content-type" content="text/html;charset=utf-8">
  <style>
	.choose{color:red;width:500px;height:300px;margin:0 auto;margin-top:150px;text-align:center;padding-top:100px;}
  </style>
  <script src="js/jquery.min.js" type="text/javascript"></script>
		<script>
 	$(document).ready( function(){
		$(".choose").click(function(){
		//点击测试,注意参数是demo中生成的package
		var appId='${appId}';
		var timeStamp='${timeStamp}';
		var nonceStr='${nonceStr}';
		var package1='${package1}';
		var signType='${signType}';
		var paySign='${paySign}';
	    WeixinJSBridge.invoke('getBrandWCPayRequest',{"appId":appId,"timeStamp":timeStamp,"nonceStr":nonceStr,"package":package1,"signType" :signType,"paySign":paySign},
	    function(res){
	       //支付成功或失败前台判断
   	       if(res.err_msg=='get_brand_wcpay_request:ok'){
   	    	   alert('恭喜您，支付成功!');
   	       }else{
   	    	   alert('支付失败');
   	       }
	     });
	     });
  });
 </script>
 </head>

 <body>
 <div align="center">
	</div>
	
	<div class="choose" >
	  Meizu/魅族 魅蓝note  <br/>
  电信版4G手机 纤薄轻巧<br/>
收藏<br/>
销售价： ￥1,370.00<br/>

型 号： 魅蓝note<br/>

库存状态： 有库存<br/>

类型： 合约机<br/>
* 颜　色: 白色<br/>
		<font size="80px">确认支付</font>
		<br><br>
	</div>
 </body>
</html>
